<script>
import { mapGetters, mapActions } from 'vuex';
export default {
  name: 'Price',
  computed: {
    ...mapGetters(['sumPrice', 'totalNum'])
  },
  methods: {
    ...mapActions(['clearAll'])
  }
}
</script>

<template>
  <div>
    <span>总数：{{ totalNum }}</span>
    <span>总价：{{ sumPrice }}</span>
    <span @click="clearAll">清空购物车</span>
  </div>
</template>

<style scoped>

</style>
